home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / HENSA / MATHS / PLPLOT / PLPLOT.ZIP / doc / colors.doc < prev    next >
Encoding:
Text File  |  1994-04-25  |  3.2 KB  |  73 lines

  1. This note explains the new PLplot color model.  
  2.  
  3. Color map 0
  4. -----------
  5.  
  6. This palette is intended for plotting axes, lines, labels, whatever.  The
  7. entire palette can be changed by calling plscmap0(), and an individual
  8. color is selected by calling plcol0() with the index of the color.
  9. Maximum number of colors is currently 16.
  10.  
  11. Color map 1
  12. -----------
  13.  
  14. Used for plots in which the data value is represented by the color.
  15. The location in color map 1 space is specified through a floating point
  16. number between 0 and 1.  This allows continuous tone plots to be made,
  17. depending on the number of colors supported by the driver.
  18.  
  19. The mapping between data value and color value is made by specifying a
  20. number of "control points".  These points have a color value (in HLS or
  21. RGB space) and a location in color map 1 (from 0 to 1).  Between these
  22. points, linear interpolation is used.  By mapping location in the color
  23. map to function value, or intensity, you can get a smooth variation of
  24. color.  Any number of control points may be specified, located at
  25. arbitrary intensities, although typically 2 - 4 are enough.  Another way
  26. of stating this is that we are traversing a given number of lines through
  27. HLS (or RGB) space as we move through cmap 1 entries.  The control points
  28. at the minimum and maximum intensity (0 and 1) must always be specified.
  29. By adding more control points you can get more variation.  One good
  30. technique for plotting functions that vary about some expected average is
  31. to use an additional 2 control points in the center (intensity ~= 0.5)
  32. that are the same color as the background (typically white for paper
  33. output, black for crt), and same hue as the boundary control points.  This
  34. allows the highs and lows to be very easily distinguished.
  35.  
  36. Each control point must specify the location in cmap 1 as well as
  37. three coordinates in HLS or RGB space.  The first point MUST correspond
  38. to location = 0, and the last to location = 1.
  39.  
  40. Bounds on RGB coordinates:
  41.     R,G,B        [0, 1]        magnitude
  42.  
  43. Bounds on HLS coordinates:
  44.     hue        [0, 360]    degrees
  45.     lightness    [0, 1]        magnitude
  46.     saturation    [0, 1]        magnitude
  47.  
  48. The inputs to plscmap1l() are:
  49.     itype        0: RGB, 1: HLS
  50.     npts        number of control points
  51.     location[]    location for each control point
  52.     coord1[]    first coordinate for each control point
  53.     coord2[]    second coordinate for each control point
  54.     coord3[]    third coordinate for each control point 
  55.  
  56.  
  57. Color map 1 has three defining constants:
  58.  
  59. 1. Number of control points.  You can use few (typical) or many.
  60.  
  61. 2. Number of sampled RGB values.  In theory, these are not needed, since
  62.    you can determine the proper RGB value from the inverse mapping as 
  63.    specified in plscmap1l().  However, to make the inverse a simple
  64.    lookup, I sample a limited number of colors at discrete locations in
  65.    cmap1 space.  Typically 256 are used (high enough that discreteness
  66.    should not be a factor).
  67.  
  68. 3. Maximum number of actual output colors.  This is driver-dependent.
  69.    E.g. it is 16-ncol0-1, where ncol0 is number of colors in cmap0, for
  70.    the tek driver (subtract 1 for the background).  The X driver can
  71.    display many in principle (over 100) but I limit the number due to
  72.    practical considerations (direct rgb, multiple plplot apps, etc).
  73.